﻿@inject NavigationManager NavigationManager

<div class="redirect-login-card">

        <MAlert Border="Borders.Left"
                ColoredBorder
                Type="AlertTypes.Error"
                Elevation="2">
            权限不足！<br/>请尝试 <a @onclick="@OnLogin" class="error--text font-weight-black">登入账号</a> ，或者联系管理员获取权限
        </MAlert>
</div>


@code {
    protected void OnLogin()
    {
        InteractiveRequestOptions requestOptions = new()
        {
            Interaction = InteractionType.SignIn,
            ReturnUrl = NavigationManager.Uri,
        };

        if (StaticOptions.IsSSR)
        {
            NavigationManager.NavigateTo($"Account/Login?returnUrl={NavigationManager.Uri.Replace(NavigationManager.BaseUri, "")}", true);
        }
        else
        {
            NavigationManager.NavigateToLogin("authentication/login", requestOptions);
        }

    }
}
